package com.hr.controller;

import com.hr.entity.ConfigMajorKind;
<<<<<<< HEAD
import com.hr.entity.R;
import com.hr.service.ConfigMajorKindService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
=======
import com.hr.service.ConfigMajorKindService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
>>>>>>> dea23c94d49077528723b4e0606ca5691f441e14

import java.util.List;

@RestController
@RequestMapping("/configMajorKind")
public class ConfigMajorKindController {
<<<<<<< HEAD
    @Autowired
    private ConfigMajorKindService service;

    /**
     * 查询
     * @return
     */
    @RequestMapping("/queryList")
    public List<ConfigMajorKind> queryList(){
        List<ConfigMajorKind> list = service.queryList();
        return list;
    }

    /**
     * 保存/修改
     * @param configMajorKind
     * @return
     */
    @PostMapping("/save")
    public R save(
            @RequestBody
            ConfigMajorKind configMajorKind){
        boolean save = service.save(configMajorKind);
        return save ? R.ok("保存成功"):R.fail("保存失败");
    }

    /**
     * 删除
     * @param mfkid
     * @return
     */
    @DeleteMapping("/del")
    public R del(Integer mfkid){
        boolean save = service.del(mfkid);
        return save ? R.ok("删除成功"):R.fail("删除失败");
    }

=======
    //自动装配
    @Autowired
    private ConfigMajorKindService configMajorKindService;

    @GetMapping("/queryList")
    public List<ConfigMajorKind> queryList(){
        List<ConfigMajorKind> list = configMajorKindService.queryList();
        System.out.println("*** list"+list);
        return list;
    }
>>>>>>> dea23c94d49077528723b4e0606ca5691f441e14
}
